package com.acme.task1;

public class Calculator {
	public static void main(String[] args) {
		
		double operand1 = 0;
		double operand2 = 0;
		
		if(args.length != 3) {
			System.out.println("the wrong input");
			return;
		} 
		try{
			operand1 = Double.parseDouble(args[0]);
			operand2 = Double.parseDouble(args[2]);
		}
		catch (NullPointerException error) {
			System.out.println("the wrong input");
			return;
		}
		catch (NumberFormatException error2) {
			System.out.println("the wrong input");
			return;
		}
		char c;
		c = args[1].charAt(0);
	
				switch (c){
					case '+': {
						System.out.println(operand1 + operand2);
						break;
					}
					case '-':{
						System.out.println(operand1 - operand2);
						break;
					}
					case '/': {
						if (operand2 == 0) {
							System.out.println("devision on zero");
							break;
						}
						System.out.println(operand1 / operand2);
						break;
					}
					case '*': {
						System.out.println(operand1 * operand2);
						break;
					}
					default:
						System.out.println("the wrong input");
				}		
	}
}
